package com.example.myhelloworld.client;

import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.HorizontalPanel;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.VerticalPanel;


/**
 * @author Habbe
 *
 *	A SidebarMenu, In this menu the players choose what tasks to play.
 *	Later on it will show puzzles required to pass a test. 
 *
 */

public class SidebarMenu {
	
	VerticalPanel optionColumn; 
	Label[] optionList;
	
	SidebarMenu(String[] options){

		
		optionColumn = new VerticalPanel();
		optionColumn.setSpacing(20);
		optionColumn.setWidth("240px");
		optionColumn.setHeight("100%");
		optionColumn.addStyleName("sideBar");
		optionList = new Label[options.length];

		for (int i = 0; i<options.length;i++){
				HorizontalPanel  item = new HorizontalPanel();
				Label itemText = new Label(options[i]);
				optionList[i] = itemText;
				item.addStyleName("optionButton");
				itemText.addStyleName("insideOptionButton");
				itemText.setSize("170px", "30px");
				item.setSize("180px", "40");
				item.setHorizontalAlignment(HorizontalPanel.ALIGN_CENTER);
				item.setVerticalAlignment(HorizontalPanel.ALIGN_MIDDLE);
				itemText.setHorizontalAlignment(HorizontalPanel.ALIGN_CENTER);


				item.add(itemText);
				optionColumn.add(item);

		}
	}
		
	public Label GetListElement(int index){
		return optionList[index];
	}
	public int getNumberOfSidebarButtons(){
		return optionList.length;
	}
	
		
	public VerticalPanel getPanel() {
		return optionColumn;
	}
	
}
